package com.beiing.tianshuai.tianshuai.retrofit;

import com.beiing.tianshuai.tianshuai.app.HttpRequestConstant;
import com.beiing.tianshuai.tianshuai.entity.CommonBean;
import com.beiing.tianshuai.tianshuai.entity.DynamicBean;
import com.beiing.tianshuai.tianshuai.entity.MyAttentionBean;
import com.beiing.tianshuai.tianshuai.entity.MyCollectionBean;
import com.beiing.tianshuai.tianshuai.entity.PersonalActivityBean;
import com.beiing.tianshuai.tianshuai.entity.PersonalDynamicBean;
import com.beiing.tianshuai.tianshuai.entity.RecommendActivityInfoBean;
import com.beiing.tianshuai.tianshuai.entity.SignUpBody;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * Created by Jinni on 2017/7/12 0012.
 */

interface ApiService {
    /**
     * 获取注册结果
     */
    @POST(HttpRequestConstant.REQUEST_SIGN_UP_RESULT)
    Observable<CommonBean> getSignUpResult(@Body SignUpBody signUpBody);

    /**
     * 获取注册验证码
     */
    @FormUrlEncoded
    @POST(HttpRequestConstant.REQUEST_SIGN_UP_CODE)
    Observable<CommonBean> getSignUpCode(
            @Field("email") String email);

    /**
     * 获取我关注的用户列表
     */
    @GET(HttpRequestConstant.REQUEST_ATTENTION_LIST + "{id}")
    Observable<MyAttentionBean> getMyAttentionResult(
            @Path("id") String email
    );

    /**
     * 获取我粉丝的用户列表
     */
    @GET(HttpRequestConstant.REQUEST_FANS_LIST + "{id}")
    Observable<MyAttentionBean> getMyFansResult(
            @Path("id") String email
    );

    /**
     * 获取我收藏的活动列表
     */
    @FormUrlEncoded
    @POST(HttpRequestConstant.REQUEST_COLLECTION_LIST)
    Observable<MyCollectionBean> getMyCollectionResult(
            @Field("uid") String id
    );

    /**
     * 获取动态列表
     */
    @GET(HttpRequestConstant.REQUEST_DYNAMIC_LIST)
    Observable<DynamicBean> getDynamicsResult(
            @Query("userid") String id,
            @Query("firstRow") int start,
            @Query("listRows") int num
    );

    /**
     * 获取个人动态列表
     */
    @FormUrlEncoded
    @POST(HttpRequestConstant.REQUEST_P_DYNAMIC_LIST)
    Observable<PersonalDynamicBean> getPersonalDynamicsResult(
            @Field("uid") String uid,
            @Field("userid") String id,
            @Field("firstRow") int start,
            @Field("listRows") int num
    );

    /**
     * 获取个人活动列表
     */
    @FormUrlEncoded
    @POST(HttpRequestConstant.REQUEST_P_ACTIVITY_LIST)
    Observable<PersonalActivityBean> getPersonalActivityResult(
            @Field("uid") String uid
    );

    @GET("tianshuai")
    Observable<RecommendActivityInfoBean> getRecommendActivityInfo();
}
